<?php

/**
 * 用户相关接口
 */
namespace Api\Controller;
use Think\Controller;
class NewsColumnController extends ApiBaseController {
	protected $news_column_model;
	
	function _initialize() {
		$this->news_column_model = D("Common/NewsColumn");
	}
		
    function queryColumn(){
    	$columns = $this->news_column_model->where("status=1")
    		->order("weight DESC")->select();
    	$ReturnData = array();
    	if(!empty($columns)){
    		$i = 0;
    		foreach ($columns as $item){
    			$ReturnData[$i]['columnId'] = $item['column_id'];
    			$ReturnData[$i]['name'] = $item['name'];
    			$ReturnData[$i]['type'] = $item['type'];
    			$i += 1;
    		}
    	}
    	
    	$data = array('Success'=>true,
    			'ResultCode'=>'0000',
    			'ReturnData'=>$ReturnData,
    			'Message'=>'查询成功'
    	);
    	$this->ajaxReturn($data);
    }
}

